package com.ys.dubbo.rest.provider.service;

import com.ys.dubbo.rest.api.CalculateService;
import org.springframework.stereotype.Service;

import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;

/**
 * <p>@description: demo dubbo-rest
 * <p>
 * dubbo协议和rest协议同时满足
 * </p>
 *
 * @author yangshuang
 * @version 1.0
 * @date 2019/6/8 16:10
 */
@Path("/")
@Service("calculateService")
@Consumes({MediaType.APPLICATION_JSON, MediaType.TEXT_XML}) // #2
@Produces({MediaType.APPLICATION_JSON, MediaType.TEXT_XML})
public class CalculateServiceImpl implements CalculateService {

    @Override
    @GET
    @Path("/divide")
    public int divide(@QueryParam(value = "a") int a, @QueryParam(value = "b") int b) {
        return 0;
    }


}
